<?php
namespace App\Http\Controllers;
use App\Models\Complaint;
use App\Models\Complainttype;

class ComplaintController extends WxBaseController{
    protected $except=['menu'];
    //提交投诉
    public function store(){
        $input = request();
        $con=keywords_check($input->con);
        $params =[
            'type'=>$input->type,
            'username'=>$input->username,
            'content'=>$con,
            'gender'=>$input->gender,
            'pic'=>$input->pic,
            'iphone'=>$input->iphone,
            'wxuser_id'=>$this->auth()->id
        ];
        $complaint = Complaint::create($params);
        return $this->apiReturn(true,'success',$complaint);
    }
    //获取投诉类型
    public function menu(){
        $menus = Complainttype::get();
        return $this->apiReturn(true,'success',$menus);
    }
}